import javax.servlet.Servlet;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLClassLoader;
import java.net.URLStreamHandler;

public class Test {
    public static void main(String[] args) throws MalformedURLException, ClassNotFoundException, IllegalAccessException, InstantiationException {
//        JSON.parseArray("[1,2,3]");

        URL[] urls = new URL[1];
        URLStreamHandler streamHandler = null;;
        String repository = (new URL("file", null,
                "F:\\program\\tomcat\\target\\classes\\webroot\\")).toString();
        urls[0] = new URL(null, repository, streamHandler);
        URLClassLoader loader = new URLClassLoader(urls);

        Class<Servlet> primitiveServlet = (Class<Servlet>) loader.loadClass("PrimitiveServlet");
        Servlet servlet = primitiveServlet.newInstance();

    }
}
